package com.techsoul.module.accounting.task;

import com.techsoul.common.core.pojo.vo.UserVo;
import com.techsoul.common.core.util.spring.SpringUtils;
import com.techsoul.module.accounting.pojo.param.AccApSkuMonthlySettlementSearchParam;
import com.techsoul.module.accounting.service.IAccApSkuMonthlySettlementService;
import com.techsoul.module.accounting.service.IAccountingApService;
import lombok.extern.slf4j.Slf4j;

import java.util.TimerTask;

/**
 * 异步工厂
 *
 * @author liuen
 */
@Slf4j(topic = "accounting-ap")
public class AccountingApAsyncFactory {

    public static TimerTask asyncGenerateArAp(final UserVo user) {
        return new TimerTask() {
            @Override
            public void run() {
                SpringUtils.getBean(IAccountingApService.class).asyncGenerateArAp(user);
            }
        };
    }

    public static TimerTask asyncGenerateMigrationArAp(final UserVo user) {
        return new TimerTask() {
            @Override
            public void run() {
                SpringUtils.getBean(IAccountingApService.class).asyncGenerateMigrationArAp(user);
            }
        };
    }

}
